<template>
  <div>
    <Header/>
    <router-view></router-view>
    <!-- 拿到当前路由mata中保存的布尔值来控制Footer组件的显示隐藏 -->
    <Footer v-show="!this.$route.meta.isFooterHidden"/>
  </div>
</template>

<script>
import Header from '@comp/Header'
import Footer from '@comp/Footer'
import {mapActions} from "vuex"
export default {
  name: "App",
  components:{
    Header,
    Footer
  },

  mounted() {
    //1.初始化请求三级列表
    this.getCateGoryList();
  },

  methods: {
    //1.请求三级列表数据的actions 因为需要多次切换组件，所以把请求放在App中减少请求次数
    ...mapActions("home", ["getCateGoryList"]),
  },
}
</script>

<style>

</style>